package com.bjsxt;

import javax.imageio.ImageIO;
import java.awt.*;
import java.io.IOException;
import java.net.URL;

/**
 * @Project: PlaneFight
 * @Author: 陈祖生
 * @Version: 1.0
 * @CreateTime: 2022/7/1 11:04
 * @Description: 游戏工具
 */
public class GameUtil {

    public static final int FRAME_WIDTH = 500;
    public static final int FRAME_HIGTH = 500;


    private GameUtil(){}

    public static Image getImage(String path){
        Image img = null;
        URL url = GameUtil.class.getClassLoader().getResource(path);
        try {
            img = ImageIO.read(url);
        }catch (IOException e){
            e.printStackTrace();
        }
        return img;
    }
}
